<!-- 浏览作业 -->
<!DOCTYPE html>
<html>
  <head>
    <title></title>
    <include file="./Public/html/_head.html"/>
  </head>

  <body ontouchstart>
    <include file="./Public/html/_refresh.html"/>
    <header class='demos-header'>
      <h1 class="demos-title">浏览作业</h1>
    </header>
    <volist name="homeworkList" id="homeworkList" empty="没有作业可供浏览">
        <div class="weui_cells weui_cells_form" id="{$homeworkList.id}">
          <div class="weui_cell">
            <div class="weui_cell_bd weui_cell_primary">
              <div class="weui_uploader">
                <div class="weui_uploader_hd weui_cell">
                  <div class="weui_cell_bd weui_cell_primary">{$homeworkList.name}</div>
                </div>
                <div class="weui_uploader_bd">
                  <ul class="weui_uploader_files">
                    
                    <notempty name="homeworkList.pic1Url">
                      <li class="weui_uploader_file" style="background-image:url(http://testet-public.stor.sinaapp.com/{$homeworkList.pic1Url})"></li>
                    </notempty>
                    <notempty name="homeworkList.pic2Url">
                      <li class="weui_uploader_file" style="background-image:url(http://testet-public.stor.sinaapp.com/{$homeworkList.pic2Url})"></li>
                    </notempty>
                    <notempty name="homeworkList.pic3Url">
                      <li class="weui_uploader_file" style="background-image:url(http://testet-public.stor.sinaapp.com/{$homeworkList.pic3Url})"></li>
                    </notempty>
                    <notempty name="homeworkList.pic4Url">
                      <li class="weui_uploader_file" style="background-image:url(http://testet-public.stor.sinaapp.com/{$homeworkList.pic4Url})"></li>
                    </notempty>
                    <notempty name="homeworkList.pic5Url">
                      <li class="weui_uploader_file" style="background-image:url(http://testet-public.stor.sinaapp.com/{$homeworkList.pic5Url})"></li>
                    </notempty>
                    <notempty name="homeworkList.pic6Url">
                      <li class="weui_uploader_file" style="background-image:url(http://testet-public.stor.sinaapp.com/{$homeworkList.pic6Url})"></li>
                    </notempty>
                  </ul>
                </div>
                <div class="weui_media_box weui_media_text" style="padding:0; position:inherit">
                  <p class="weui_media_desc">作业得分：{$homeworkList.mark}</p>
                  <ul class="weui_media_info">
                    <li class="weui_media_info_meta">批改人</li>
                    <li class="weui_media_info_meta">{$homeworkList.correcter}</li>
                    <li class="weui_media_info_meta weui_media_info_meta_extra"><if condition="$homeworkList.correcter eq '未批改'">提交时间：{$homeworkList.time}<else />批改时间：{$homeworkList.correctTime}</if></li>
                  </ul>
                </div>
              </div>
            </div>
          </div>
        </div>
    </volist>
    <include file="./Public/html/_foot.html"/>
    <include file="./Public/html/_refreshJs.html"/>
  </body>
</html>


<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script>
      $(document).ready(function(){
          wx.config({
              debug: false,
              appId: '{$signPackage.appId}',
              timestamp: {$signPackage.timestamp},
              nonceStr: '{$signPackage.nonceStr}',
              signature: '{$signPackage.signature}',
              jsApiList: [
                'previewImage',
              ]
          });

          $('.weui_uploader_file').click(function(){
            var picUrlArray = new Array();
            var get = $(this).parent().children();
            
            get.each(function(i,n){
              picUrlArray[i] = $(this).css('background-image').substring(4,$(this).css('background-image').length-1);
            });

            picJsonUrl = JSON.stringify(picUrlArray);

            wx.previewImage({
              urls: picJsonUrl,
            });
          });
      });
    </script>
